package com.jack.xiaoer.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jack.xiaoer.dto.CartDTO;
import com.jack.xiaoer.entity.Cart;
import com.jack.xiaoer.entity.Shop;

import java.util.List;
import java.util.Optional;

/**
 * Created by Jackaroo Zhang on 2018/12/19.
 */
public interface CartService {

    Cart add(Optional<CartDTO> cartDtoOptional);

    IPage<Cart> listByUserId(Long userId, Integer pageNum, Integer pageSize);

    Integer countItem(Long userId, Long shopId, Integer checked);

    List<Shop> listShopByUserId(Long userId);

    List<Cart> listByUserIdAndShopId(Long userId, Long shopId, boolean checked);

    boolean updateCheckedByCartId(Long cartId, Integer checkedCode);

}
